#关系运算符
a = 10
b = 20.1
c = 'hello'
d = 'hf'
print(a <= b)
print(a >= b)
print(a == b)
print(c == a)
#print(c >= a)报错
print(c != a)
print(c >= d)#字典序比较

# a = '你好'
# b = '世界'
# print(a == b)#针对中文比较没意义

#针对浮点数,使用==可能存在风险
print(20 == 20.0)
print(0.1+0.2 == 0.3)#
print(0.1+0.2)#0.30000000000000004会丢失精度
print(-0.000001<0.3-(0.1+0.2)<0.00001)

print(a > b and 10/0 == 1)#此处短路,没有抛出异常